package remote_service

import (
	"io"
	"net/http"
	"net/url"
)

type Customer struct {
}

func (Customer) CustomerInfo(name string) (string, error) {
	u := "http://cus-go:28091/customer/info"
	uv := url.Values{}
	uv.Add("name", name)
	u += "?" + uv.Encode()
	resp, errR := http.DefaultClient.Get(u)
	if errR != nil {
		return "", errR
	}
	ret, err := io.ReadAll(resp.Body)
	return string(ret), err
}
